<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
    <title>Title</title>
</head>
<div>
    <header th:replace="common/top">
    </header>

    <h2>My Orders</h2>

    <table>
        <tr>
            <th>Order ID</th>
            <th>Date</th>
            <th>Total Price</th>
        </tr>

        <tr th:if="${session.orderList} == null">
            <td colspan="3"><b>Your orderList is empty.</b></td>
        </tr>



        <tr th:each="order:${session.orderList}">
            <td>
                <!--                <a href="/order/viewOrder?orderId=${order.orderId}">${order.orderId}</a>-->
                <!--                <a th:href="@{/order/viewOrde?orderId=}+${order.orderId}"  th:text="${order.orderId}">${order.orderId}</a>-->
                <a th:href="@{/order/viewOldOrder?orderId=}+${order.orderId}"  th:text="${order.orderId}">${order.orderId}</a>
                <!--                <a th:href="@{/order/viewOrder(orderId=${order.orderId})">${order.orderId}</a>-->
            </td>
            <td th:text="${#dates.format(order.orderDate,'yyyy/MM/dd hh:mm:ss')}">
                <!--                <fmt:formatDate value="${order.orderDate}" pattern="yyyy/MM/dd hh:mm:ss" />-->
            </td>
            <td th:text="'$'+${#numbers.formatDecimal(order.totalPrice,1,2)}">
                <!--                <fmt:formatNumber value="${order.totalPrice}" pattern="$#,##0.00" />-->
            </td>
        </tr>
    </table>

    <footer th:replace="common/bottom">
    </footer>
</div>
</body>
</html>